package com.psp.web.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.northend.util.AppTextUtil;
import com.psp.web.controller.res.bean.RCartListBean;
import com.psp.web.controller.res.bean.RServicesListBean;
import com.psp.web.service.ShopcartService;
import com.psp.web.service.exception.ServiceException;

@Service
public class ShopcartServiceImpl implements ShopcartService {

	@Override
	public PageResult<RCartListBean> getCartList(int page, int pageSize, String uid) {
		PageResult<RCartListBean> result = new PageResult<RCartListBean>();

		List<RCartListBean> lists = new ArrayList<>();

		for (int i = 0; i < 4; i++) {
			RCartListBean bean = new RCartListBean();
			bean.setCid(AppTextUtil.getPrimaryKey());
			bean.setSid(AppTextUtil.getPrimaryKey());

			RServicesListBean ser = new RServicesListBean();
			ser.setSid(AppTextUtil.getPrimaryKey());
			ser.setIcon("http://pic.58pic.com/58pic/14/00/69/66858PICNfJ_1024.jpg");
			ser.setNum(1);
			ser.setPrice(699.0);
			ser.setTitle("工商服务");
			bean.setServices(ser);
			lists.add(bean);
		}
		result.setData(lists);
		result.setCount(4);
		return result;
	}

	@Override
	public boolean add(String uid, String sid) throws ServiceException {
		boolean flag = false;

		flag = true;

		return flag;
	}

	@Override
	public boolean del(String uid, String sid) throws ServiceException {
		boolean flag = false;

		flag = true;

		return flag;
	}

	@Override
	public boolean sync(String uid, String sids) throws ServiceException {
		boolean flag = false;

		flag = true;

		return flag;
	}

}
